
package smpl.auth.google;

import org.apache.commons.httpclient.HttpClient;
import org.apache.commons.httpclient.HttpMethod;
import org.apache.commons.httpclient.NameValuePair;
import org.apache.commons.httpclient.methods.PostMethod;

public class HTTPClientUtil {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		HttpClient httpClient=new HttpClient();
		HttpMethod httpMethod=new PostMethod(AuthConstants.GOOGLE_AUTH_URL);
		NameValuePair[] data = {
				new NameValuePair("accountType", AuthConstants.GOOGLE_AUTH_TYPE),
				new NameValuePair("Email", "managanesh@gmail.com"),
				new NameValuePair("Passwd", "Gmail1231"),
				new NameValuePair("service", "mail"),
				new NameValuePair("source", "sampurnastorage-google"),
		};


		httpMethod.setQueryString(data);

		try{
			httpClient.executeMethod(httpMethod);

		}catch(Exception e){
			e.printStackTrace();
		}

		String status=httpMethod.getStatusText();
		System.out.println("Status::::"+status);
		httpMethod.releaseConnection();

	}

}
